gen-fibonacci constructs fibonacci symbols from seed-element1 and seed-element2. New material is formed by appending the previously generated fibonacci symbols together. The process depth is controlled by the level. Use this function to generate melodies or rhythms, which are at same time regular yet changing and grow organically.
(gen-fibonacci 1 'a 'b) --> (a b)
(gen-fibonacci 2 'a 'b) --> (a b a)
(gen-fibonacci 3 'a 'b) --> (a b a a b)
(gen-fibonacci 4 'a 'b) --> (a b a a b a b a)
(gen-fibonacci 5 'a 'b) --> (a b a a b a b a a b a a b)
(gen-fibonacci 6 'a 'b) --> (a b a a b a b a a b a a b a b a a b a b a)
For example, this is quite monotonic and boring by itself.
(gen-fibonacci 6 'a 'b)
--> (a b a a b a b a a b a a b a b a a b a b a)
But mixing brownian noise to it breaks the structure and makes it more interesting.
(gen-random-variate 0.8 0.9 0 1 (gen-fibonacci 6 'a 'b))
--> (a b a a b b c b b c b b c a b a a b a b a)
The sequence of symbols in a list above may represent velocities, rhythms, melodies, chord sequences, section structures, what ever you want to give them a meaning.
About nested fibonacci structures
Nested fibonacci structures lead in interesting forms, like in the following. When you visualize the output it looks like arabian writing.
(gen-fibonacci 5 (gen-fibonacci 3 'a 'b) (gen-fibonacci 3 'c 'd))
--> (a b a a b c d c c d a b a a b a b a a b c d c c d a b a a b c d c
c d a b a a b a b a a b c d c c d a b a a b a b a a b c d c c d)
4th level recursive expansion of the fibonacci source above makes it a fibonacci fractal. It might be interesting melodic source material to start exploring further.
(defsym a (gen-fibonacci 3 'a 'b))
(defsym b (gen-fibonacci 3 'c 'd))
(defsym c '(a b))
(gen-trans a 4)
--> (a b c d e f e e f e g h g g h d e f e e f d e f e e f e g h g
g h d f e f g f e f f e f g c d e f e e f e g h g g h d e f e e f
d e f e e f e g h g g h c d e f e e f e g h g g h d e f e e f d e
f e e f e g h g g h d f e f g f e f f e f g c e d e f e e f e g h
g g h f e d e f e e f e g h g g h e d e f e e f e g h g g h f b c
d e f e e f e g h g g h d e f e e f d e f e e f e g h g g h d f e
f g f e f f e f g c d e f e e f e g h g g h d e f e e f d e f e e
f e g h g g h c d e f e e f e g h g g h d e f e e f d e f e e f e
g h g g h d f e f g f e f f e f g b c d e f e e f e g h g g h d e
f e e f d e f e e f e g h g g h d f e f g f e f f e f g c d e f e
e f e g h g g h d e f e e f d e f e e f e g h g g h c d e f e e f
e g h g g h d e f e e f d e f e e f e g h g g h d f e f g f e f f
e f g c e d e f e e f e g h g g h f e d e f e e f e g h g g h e d